package com.shq.ex1;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class ULActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ul);

        final Button btnEnter=(Button)findViewById(R.id.btnEnter);
        final EditText edituser=(EditText)findViewById(R.id.editUserName);
        final EditText editPassWord=(EditText)findViewById(R.id.editPassWord);

        btnEnter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String user = edituser.getText().toString();
                String password = editPassWord.getText().toString();

                Log.v("LoginApp","输入的用户名为："+edituser);
                Log.v("LoginApp","输入的密码为："+editPassWord);
                if(user.equals("zhht")&&password.equals("111111")){
                    Log.v("LoginApp","登陆成功！");
                }else{
                    Log.v("LoginApp","登陆失败！");
                }

            }
        });
    }

}
